﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Workflow.ComponentModel.Design;
using System.Drawing;

namespace WorkflowLibrary.Activities
{
    class ExecuteCodeActivityDesigner : ActivityDesigner
    {
        protected override Size OnLayoutSize(ActivityDesignerLayoutEventArgs e)
        {
            return new Size(320, 50);
        }

        protected override void OnPaint(ActivityDesignerPaintEventArgs e)
        {
            e.Graphics.FillRectangle(Brushes.Gold,
            Location.X, Location.Y,
            Size.Width, Size.Height);
            StringFormat format = new StringFormat();

            format.Alignment = StringAlignment.Center;
            Rectangle rect = new Rectangle(Location.X, Location.Y,
            Size.Width, 15);
            e.Graphics.DrawString((Activity as IActivityName).ActivityName,
            DesignerTheme.Font,
            Brushes.Gray, rect, format);
        }
    }
}
